const util = require('../../../utils/util.js')
//获取未领取列表
function requestNoReceive(page,  callback) {
  getApp().func.Get(false, getApp().api.noReceive, { "page": page, "period_type": 3},
  function(data) {
      typeof callback == "function" && callback(data)
  },
  function(error) {
    console.log(error)
    wx.showToast({
      title: error.data.message,
      icon: 'none',
      duration: 2000
    })
  })
};
// 获取实物奖励列表
function requestAwardList(page, callback) {
  getApp().func.Get(false, getApp().api.awardList, { "pageNo": page, pageSize: 20, winningType: 1, "period_type": 3},
  function(data) {
      typeof callback == "function" && callback(data)
  },
  function(error) {
    console.log(error)
    wx.showToast({
      title: error.data.message,
      icon: 'none',
      duration: 2000
    })
  })
};

// 领取果冻
function requestJelly(id, callback) {
  getApp().func.Post(false, getApp().api.getJelly, { "id": id, "period_type": 3},
  function(data) {
      typeof callback == "function" && callback(data)
  },
  function(error) {
    console.log(error)
    wx.showToast({
      title: error.data.message,
      icon: 'none',
      duration: 2000
    })
  })
};



module.exports = {
  requestNoReceive: requestNoReceive,
  requestAwardList: requestAwardList,
  requestJelly: requestJelly
};